<style>
    .zoomify.zoomed {
        position: absolute;
    }
</style>
<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl', Array('_BTN_GROUP' => array('url' => site_url($thisModule . $thisController), 'class' => 'btn default', 'name' => '返回列表', 'i' => '<i class="m-icon-swapleft"></i>'))) ?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
    <div class="col-xs-12 ">
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <div>
            <div class="tabbable">
                <div class="tab-content">
                    <div class="tab-pane active" id="tab_1">
                        <!-- 任务信息开始 -->
                        <div class="row">
                            <div class="col-md-12 col-sm-12">
                                <div class="portlet box green">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-cogs"></i>任务详情
                                        </div>
                                    </div>
                                    <div class="table-scrollable">
                                        <table class="table table-hover table-bordered table-striped">
                                            <tr>
                                                <td align="right" width="12.5%">任务ID：</td>
                                                <td class="bold" width="12.5%"><?= $obj->id ?></td>
                                                <td align="right" width="12.5%">所属账户：</td>
                                                <td class="bold" width="12.5%"><?= IOSS_StaticConfig::getAllShops()[$obj->shop_id] ?></td>
                                                <td align="right" width="12.5%">下单店铺：</td>
                                                <td class="bold"
                                                    width="12.5%"><?= $obj->related_shop ?></td>
                                                <td align="right" width="12.5%">商品名称：</td>
                                                <td class="bold" width="12.5%"><?= $obj->product_name ?></td>
                                            </tr>
                                            <tr>
                                                <td align="right">ASIN：</td>
                                                <td class="bold"><?= $obj->asin ?></td>
                                                <td align="right">商品链接：</td>
                                                <td class="bold"><a class="btn blue" href="<?= $obj->link ?>"
                                                                    target="_blank">查看商品</a>
                                                </td>
                                                <td align="right">要求/完成 销量数量：</td>
                                                <td class="bold"><?= $obj->sale_need_num . ' / ' . $obj->sale_finish_num ?></td>
                                                <td align="right">要求/完成 测评数量：</td>
                                                <td class="bold"><?= $obj->comment_need_num . ' / ' . $obj->comment_finish_num ?></td>
                                            </tr>
                                            <tr>
                                                <td align="right">创建时间：</td>
                                                <td class="bold"><?= date('Y-m-d H:i:s', $obj->create_time) ?></td>
                                                <td align="right">更新时间：</td>
                                                <td class="bold"><?= date('Y-m-d H:i:s', $obj->update_time) ?></td>
                                                <td align="right">任务联系人：</td>
                                                <td class="bold"><?= $allDistribution[$obj->task_contact_id] ?></td>
                                                <td align="right">状态：</td>
                                                <td class="bold"><?= MTask::getState($obj->status) ?></td>
                                            </tr>
                                            <tr>
                                                <td align="right">搜索关键词：</td>
                                                <td class="bold"><?= $obj->search_key ?></td>
                                                <td align="right">搜索排名：</td>
                                                <td class="bold"><?= $obj->amazon_order ?></td>
                                                <td align="right">所属国家：</td>
                                                <td class="bold"><span
                                                            class="label label-primary"><?= IOSS_StaticConfig::getCountryInfo($obj->country) ?></span>
                                                </td>
                                                <td align="right">是否加急：</td>
                                                <td class="bold"><?= MTask::getUrgent($obj->is_urgent) ?></td>
                                            </tr>
                                            <tr>
                                                <td align="right">商品图片</td>
                                                <td class="bold">
                                                    <img class="img-rounded" src="<?= image_url($obj->image) ?>"
                                                         width="80" height="80"/>
                                                </td>
                                                <td align="right" width="12.5%">创建者：</td>
                                                <td class="bold"
                                                    width="12.5%"><?= $allDistribution[$obj->creator_id] ?></td>
                                                <td align="right">所属销售组：</td>
                                                <td><?= $allGroups[$obj->group_id] ?></td>
                                                <td align="right">发布任务时商品的店铺价格：</td>
                                                <td><?= $obj->price == 0.00 ? '未填' : $obj->price ?></td>

                                            </tr>
                                            <tr>
                                                <td align="right">利润率：</td>
                                                <td class="bold"><label class="label label-success"><?= $obj->profit_rate ?>%</label></td>
                                                <td align="right">备注：</td>
                                                <td colspan="6" class="bold"><?= $obj->remark ?></td>
                                            </tr>
                                            <?php if (in_array($this->_user->role_id, array(2, 3, 4, 5))): ?>
                                                <tr>
                                                    <td align="right">操作：</td>
                                                    <td colspan="7" class="bold">
                                                        <?php if ($obj->is_apply): ?>
                                                            <a class="btn btn-md yellow-gold"
                                                               href="<?= site_url($thisModule . 'taskrecords/add/' . $obj->id) ?>">我要录单</a>
                                                        <?php else: ?>
                                                            <a class="btn btn-md red"
                                                               href="<?= site_url($thisModule . 'task') ?>">暂未接单或测评录入已达所接数量，请先去任务列表接单后进行录单</a>
                                                        <?php endif; ?>
                                                    </td>
                                                </tr>
                                            <?php endif; ?>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 任务信息结束 -->
                        <!-- 任务操作记录开始 -->
                        <div class="row">
                            <?php if (count($allOperatesOfTaskId)): ?>
                                <div class="col-md-12 col-sm-12">
                                    <div class="portlet box green">
                                        <div class="portlet-title">
                                            <div class="caption">
                                                <i class="fa fa-cogs"></i>测评记录
                                            </div>
                                        </div>
                                        <div class="table-scrollable">
                                            <table class="table table-hover table-bordered table-striped">
                                                <thead>
                                                <tr>
                                                    <th width="3%">ID</th>
                                                    <th width="4%">接单者</th>
                                                    <th width="6%">买家下单单号</th>
                                                    <th width="7%">买家下单时间</th>
                                                    <th width="7%">买付款时间</th>
                                                    <th width="5%">评论链接</th>
                                                    <th width="4%">商品实价</th>
                                                    <th width="2%">记录类型</th>
                                                    <th width="6%">创建时间</th>
                                                    <th width="6%">备注信息</th>
                                                    <th width="6%">操作</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                <?php if (count($allOperatesOfTaskId)): ?>
                                                    <?php foreach ($allOperatesOfTaskId as $v) { ?>
                                                        <tr>
                                                            <td><?= $v->id ?></td>
                                                            <td><?= $allReviewsAdmin[$v->operator_id]; ?></td>
                                                            <td><?= $v->order_no ?></td>
                                                            <td><?= $v->buyer_order_time > 0 ? date('Y-m-d', $v->buyer_order_time) : '未填' ?></td>
                                                            <td><?= $v->buyer_pay_time > 0 ? date('Y-m-d', $v->buyer_pay_time) : '未填' ?></td>
                                                            <td>
                                                                <?php if ($v->comment_link): ?>
                                                                    <a class="btn btn-sm blue"
                                                                       href="<?= $v->comment_link ?>" target="_blank"><i
                                                                                class="fa fa-play"></i>查看</a>
                                                                <?php else: ?>

                                                                <?php endif; ?>
                                                            </td>
                                                            <td><?= $v->true_product_price > 0 ? number_format($v->true_product_price, 2, '.', '') : '' ?></td>

                                                            <td class="text-center popovers"><?= $v->ceping_type==0?'未标定':$v->ceping_type==1?'销量':'测评';?></td>
                                                            <td><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
                                                            <td><?= $v->remark; ?></td>
                                                            <td>
                                                                <a href="javascript:ioss_url_modal('<?= site_url('/tasks/taskrecords/ajaxViewDetail/' . $v->id) ?>');"
                                                                   class="btn btn-sm blue <?php
                                                                   if (in_array($this->_user->role_id, array(3,5)) && $v->operator_id !== $this->_user->id) {
                                                                       echo 'disabled';
                                                                   } else {
                                                                       echo '';
                                                                   }
                                                                   ?> <?= $p->read ? '' : 'disabled' ?>"><i
                                                                            class="fa fa-play "></i> 查看</a>
                                                            </td>
                                                        </tr>
                                                    <?php } ?>

                                                <?php endif; ?>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            <?php else: ?>
                                <div class="col-md-12 col-sm-12">
                                    <center><span class="label label-info">暂无测评记录</span></center>
                                </div>
                            <?php endif; ?>
                            <!-- 任务操作记录结束 -->
                        </div>
                    </div>
                </div>
            </div>
            <!-- END SAMPLE FORM PORTLET-->
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $('.img-rounded').zoomify();
    })
</script>
<!-- END PAGE CONTENT-->
